package com.siyoumi.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.siyoumi.entity.base.SysAccsuperConfigBase;
import com.siyoumi.util.XStr;
import lombok.Data;
import lombok.experimental.Accessors;


@Data
@Accessors(chain = true)
@TableName(value = "t_s_accsuper_config", schema = "wx_app")
public class SysAccsuperConfig
        extends SysAccsuperConfigBase {
    /**
     * 主站
     *
     * @param x
     */
    static public Boolean master(String x) {
        return "x".equals(x);
    }

    /**
     * 小程序帐号
     */
    public Boolean wxApp() {
        return "wxapp".equals(getAconfig_type());
    }

    public Boolean wx() {
        return "wx".equals(getAconfig_type());
    }

    /**
     * 开放平台授权
     */
    public Boolean wxOpen() {
        return getAconfig_wxopen() == 1;
    }

    /**
     * 授权子站点
     */
    public Boolean wxOpenClient() {
        return getAconfig_wxopen() == 1 && XStr.hasAnyText(getAconfig_wxopen_parent());
    }

    public Boolean corp() {
        return "corp".equals(getAconfig_type());
    }
}
